package com.example.maastock.ontime.quartz;

import com.example.maastock.ontime.OnlineController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SimpleScheduledTask {

    @Autowired
    private OnlineController onlineController;

    @Scheduled(fixedRate = 600000) // 每 5 秒执行一次
    public void executeTask() {
        System.out.println("定时任务执行：" + System.currentTimeMillis());
        onlineController.sendMessageFeiShu(null);
    }
}
